package com.xjrsoft.module.system.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


/**
 * @author Wwn
 */
@Data
public class RegisterDto {

    @ApiModelProperty(value = "账号")
    @NotBlank(message = "账号不能为空！")
    private String userName;

    @ApiModelProperty(value = "密码")
    @NotBlank(message = "密码不能为空！")
    private String password;

    @ApiModelProperty("姓名")
    @NotNull(message = "姓名不能为空")
    private String name;

    @ApiModelProperty("性别")
    @NotNull(message = "性别必须选择")
    @Range(min = -1, max = 2, message = "性别参数不正确！")
    private Integer gender = -1;

    @ApiModelProperty("手机号")
    @NotNull(message = "手机不能为空")
    @Pattern(regexp = "1[3-9][0-9]\\d{8}", message = "手机号格式不正确！")
    private String mobile;

    @ApiModelProperty("角色")
    @NotNull(message = "角色不能为空")
    private String roleType;

    @ApiModelProperty(value = "设备类型-默认为PC，pc为0，app为1", required = false)
    private Integer deviceType;

}
